package homeWork2;

import java.util.List;

public class NFA {
    private Node start;
    private Node end;
    private List<Character> relations;
    private List<Edge> edges;

    public NFA() {
    }

    public NFA(Node start, Node end, List<Character> relations, List<Edge> edges) {
        this.start = start;
        this.end = end;
        this.relations = relations;
        this.edges = edges;
    }

    public Node getStart() {
        return start;
    }

    public void setStart(Node start) {
        this.start = start;
    }

    public Node getEnd() {
        return end;
    }

    public void setEnd(Node end) {
        this.end = end;
    }

    public List<Character> getRelations() {
        return relations;
    }

    public void setRelations(List<Character> relations) {
        this.relations = relations;
    }

    public List<Edge> getEdges() {
        return edges;
    }

    public void setEdges(List<Edge> edges) {
        this.edges = edges;
    }

    @Override
    public String toString() {
        return "NFA{" +
                "start=" + start +
                ", end=" + end +
                ", relations=" + relations +
                ", edges=" + edges +
                '}';
    }

    //边类
    public static class Edge{
        private Node start;
        private Node end;
        private Character relations;

        @Override
        public String toString() {
            return "\nEdge{" +
                    start + "----" + " " + relations + " " + "---->" + end;
        }

        public Node getStart() {
            return start;
        }

        public void setStart(Node start) {
            this.start = start;
        }

        public Node getEnd() {
            return end;
        }

        public void setEnd(Node end) {
            this.end = end;
        }

        public Character getRelations() {
            return relations;
        }

        public void setRelations(Character relations) {
            this.relations = relations;
        }

        public Edge() {
        }

        public Edge(Node start, Node end, Character relations) {
            this.start = start;
            this.end = end;
            this.relations = relations;
        }
    }

    //节点类
    public static class Node{
        private Integer ID;
        private Integer state;

        @Override
        public String toString() {
            return ID.toString();
        }

        public Integer getID() {
            return ID;
        }

        public void setID(Integer ID) {
            this.ID = ID;
        }

        public Integer getState() {
            return state;
        }

        public void setState(Integer state) {
            this.state = state;
        }

        public Node() {
        }

        public Node(Integer ID, Integer state) {
            this.ID = ID;
            this.state = state;
        }
    }
}
